

package org.apache.ocean.udp;

import java.net.*;

/**
 *
 * @author jasonr
 */
public class UDPConstants {
  public static final String CELL_CHANNEL = "cell";
  public static final String NAME_CELL_CHANNEL = "namecell";
  public static final String NAME_SEARCH_CLIENT_CHANNEL = "namesearchclient";
  
  public static final int NAME_SERVICE_MULTICAST_PORT_INCREMENT = 4160;
  public static final int MERGE_SERVICE_MULTICAST_PORT_INCREMENT = 4161;
  public static final int SEARCH_SERVICE_MULTICAST_PORT_INCREMENT = 4162;
  
  public static final int SEARCH_UDP_PORT_INCREMENT = 8005;
  public static final int NAME_UDP_PORT_INCREMENT = 8004;
  public static final int MERGE_UDP_PORT_INCREMENT = 8006;
  
  public static final String NAMES_VOTING_ACTION = "namesvoting";
  public static final String FILE_EVENT_ACTION = "fileevent";
  public static final String NAME_EVENT_ACTION = "nameevent";
  public static final String CELL_TRANSACTION_EVENT_ACTION = "celltransactionevent";
  
  private static InetAddress multicastAddress;
  
  public static final InetAddress getMulticastAddress() throws UnknownHostException {
    if (multicastAddress == null)
      multicastAddress = InetAddress.getByName("224.0.1.84");
    return multicastAddress;
  }
}
